package com.hkts.naturalgasauthentication.base.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.hkts.naturalgasauthentication.common.constant.CommonConstant;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "role")
@Data
public class Role extends ManagementBaseEntity{
    private static final long serialVersionUID = 1L;

    @Column(name = "name")
    private String name;
    @Column(name = "default_role")

    private Boolean defaultRole;

    //数据权限类型
    @Column(name = "data_type")
    private Integer dataType = CommonConstant.DATA_TYPE_ALL;

    @Column(name = "description")
    private String description;

    @Transient
    @TableField(exist=false)
    private List<RolePermission> permissions;

    @Transient
    @TableField(exist=false)
    private List<RoleDepartment> departments;
}
